/*
 * ListaUbicacionAction.java
 *
 * Created on 28 de enero de 2008, 01:59 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package perucuy.logic;
import java.lang.reflect.*;
import java.util.*;

import org.apache.log4j.Logger;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
import org.apache.struts.validator.DynaValidatorForm;
import perucuy.services.UbicacionService;

/**
 *
 * @author OMATEO
 */
public class ListaUbicacionAction extends Action {
    private static Logger log = Logger.getLogger(ListaUbicacionAction.class);
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws
            InvocationTargetException, IllegalAccessException {
        log.debug("ingresa a listar las ubicaciones");
        
        //Se procede a obtener el listado de albergados
        UbicacionService ubicasrv = new UbicacionService();
        List lista = ubicasrv.getGalpon();
        log.debug("Dato de la lista "+lista);
        assert lista != null:"no se obtuvo lista. filtro=";
        if (lista != null && lista.size()>0)request.setAttribute("listadoGalpon", lista);
        return mapping.findForward("success");
    }
}
